home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 010 / darts.bas (.txt) < prev    next >
Encoding:
GW-BASIC  |  1984-04-24  |  1.7 KB  |  45 lines

  1. 10  CLS:KEY OFF
  2. 20  COLOR 15,0:PRINT TAB(32);"BULLSEYE":COLOR 7,0
  3. 30  PRINT TAB(15);"Dart game for the IBM Personal Computer"
  4. 40  PRINT :PRINT :PRINT
  5. 50  PRINT TAB(10);"In this game, up to 20 players throw at the target"
  6. 60  PRINT TAB(10);"with 10,20,30 and 40 point zones. The objective is"
  7. 70  PRINT TAB(10);"to get 200 points.":PRINT
  8. 80  COLOR 1,0:PRINT "Throw";TAB(20);"Description";TAB(45);"Probable score           ":COLOR 7,0
  9. 90  PRINT " 1";TAB(20);"Fast overarm";TAB(45);"Bullseye or complete miss"
  10. 100  PRINT " 2";TAB(20);"Controlled overarm";TAB(45);"10, 20 or 30 points"
  11. 110  PRINT " 3";TAB(20);"Underarm";TAB(45);"Anything":PRINT
  12. 120  DIM A$(20),S(20),W(10): M=0: R=0: FOR I= 1 TO 20: S(I)=0: NEXT I
  13. 130  INPUT "How many players";N:PRINT
  14. 140  IF N=0 THEN PRINT "Nobody to throw the dart's ... End of game!":KEY ON:END
  15. 150  IF N>20 THEN PRINT "Up to 20 players":GOTO 130
  16. 160  FOR I=1 TO N
  17. 170  PRINT "Name of player no. ";I;: INPUT A$(I)
  18. 180  NEXT I
  19. 190  R=R+1:PRINT :PRINT "ROUND";R
  20. 200  FOR I= 1 TO N
  21. 210  PRINT :PRINT A$(I)"'s throw";: INPUT T
  22. 220  IF T<0 OR T>3 THEN PRINT "INPUT 1, 2, or 3 !": GOTO 210
  23. 230  GOSUB 410: ON T GOTO 240,250,240
  24. 240  P1=0.65:P2=0.55:P3=0.5:P4=0.5:GOTO 270
  25. 250  P1=0.99:P2=0.77:P3=0.43:P4=0.01:GOTO 270
  26. 260  P1=0.95:P2=0.75:P3=0.45:P4=0.05
  27. 270  U=RND(1)
  28. 280  IF U>=P1 THEN GOSUB 420:PRINT "BULLSEYE !!  40 Points":B=40:GOTO 330
  29. 290  IF U>=P2 THEN GOSUB 430:PRINT "30-Point zone":B=30:GOTO 330
  30. 300  IF U>=P3 THEN GOSUB 430:PRINT "20-Point zone":B=20:GOTO 330
  31. 310  IF U>=P4 THEN GOSUB 430:PRINT "10-Point zone":B=10:GOTO 330
  32. 320  GOSUB 440: PRINT "Missed the target! Too bad.":B=0
  33. 330  S(I)=S(I)+B:PRINT "Total score for ";A$(I);" is";S(I):NEXT I
  34. 340  FOR I=1 TO N
  35. 350  IF S(I)>=200 THEN M=M+1:W(M)=I
  36. 360  NEXT I
  37. 370  IF M=0 THEN 190
  38. 380  PRINT :PRINT "We have a winner !!":PRINT
  39. 390  FOR I= 1 TO M:PRINT A$(W(I));" scored";S(W(I));"points.":NEXT I
  40. 400  PRINT :PRINT "THANKS for the game.":KEY ON:END
  41. 410  FOR Z=800 TO 50 STEP-20: SOUND Z,0.5:NEXT:RETURN
  42. 420  PLAY "l16cdefgab":RETURN
  43. 430  FOR Z=1 TO 3: SOUND 400,3:SOUND 200,3:NEXT:RETURN
  44. 440  SOUND 125,14:SOUND 55,9:RETURN
  45.